﻿<?php 
    session_start();
    include "connect.php"; 
	
	if (!isset($_SESSION["taikhoan"]))
	{
		header("Location: sv-dangnhap.php");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sinh Viên chọn học phần đánh giá</title>
<style type="text/css">

a	{
		color: #006600;
		text-decoration: none;
	}

a:hover { COLOR: #CC0000}

.style2 {
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
}
.style3 {font-size: 14px; font-weight: bold; color: #FFFFFF; }
.style4 {
	color: #000099;
	font-weight: bold;
	font-size:20px;
}
.style5 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 30px;
}
.bg {	border-right-color:#0066FF;
		border-bottom-color:#0066FF;
	}

.bg1 {	border-bottom-color:#0066FF;}
.bg2 {	border-top-color:#0066FF;}
.bg3 {	border-left-color:#0066FF;}
.bg4 {	border-right-color:#0066FF;}
.mo	{	color:#0000FF;	}

</style>
</head>

<body>
<?php
        $masv=$_SESSION['sv'];

		$sql = mysql_query("Select a.ma_sv,a.ma_lop,a.ten_sv, a.namsinh_sv, a.gioitinh_sv, c.ten_khoa,d.ten_bm, b.khoa FROM `sinh vien` a, `lop sinh vien` b, `khoa` c, `bo mon` d where a.ma_sv='$masv' and a.ma_lop=b.ma_lop and b.ma_bm=d.ma_bm and d.ma_khoa=c.ma_khoa") ;		
		while($rows = mysql_fetch_array($sql))
		{
			$mssv=$rows["0"];
			$malop=$rows["1"];
			$ten=$rows["2"];
			$namsinh=$rows["3"];
			$gioitinh=$rows["4"];
			$khoa=$rows["5"];
			$bomon=$rows["6"];
			$k=$rows["7"];
	    }
	
?>

<table width="900" height="550" border="0" align="center" bordercolorlight="#CCCCCC" style="border:1px solid #CCCCCC">

<!-- đầu trang --> 	
	<tr> <td width="900" height="70" background="image/header.gif">
    	
        <table width="100%" height="100%" border="0"> 
          <tr>
       		
          <td width="10%" rowspan="2"><img src="image/logo.gif" width="100%" height="70" /></td>
            
            <td width="60%" rowspan="2" height="70" align="center" style="font-size:24px"><div align="center">
              <blockquote>
                <p><span class="style5">Website ĐÁNH GIÁ HỌC PHẦN</span></p>
              </blockquote>
          </div></td>
   		  	
          <td width="30%" valign="bottom"> <table>
       		  <tr><td valign="bottom">
           	  <div align="center" class="style3">
              	<a class="style3" href="helpsv.htm" target="_blank">Hướng dẫn</a> | <a class="style3" href="sv-trangchu.php">Trang chủ</a> | <a class="style3" href="logout.php">Thoát</a></div></td></tr>
       	  	  <tr><td valign="bottom">
           	  <div align="center" class="style3">Xin chào, <?php echo $ten; ?> - <?php echo $mssv; ?></div></td></tr> 
   	  	  </table> </td>
        
        </tr> </table>
    
    </td> </tr>

	<tr> <td height="50" width="100%" bordercolor="#FFFFFF"></td> </tr>

<!-- thân trang --> 	
	<tr bordercolor="#FFFFFF"> 
          
          <td width="900" height="350" align="center"  >
		  
				  <table width="880"  border="1"  align="center" bordercolor="#0066FF" cellpadding="0" cellspacing="0">
				  
				  
				        <tr bordercolor="#FFFFFF"> 
        	                  <td height="35" colspan="6" align="center" background="image/bg_header.gif" class="bg2 bg3 bg4">
            	<span style="font-size:24px; color:#FFFFFF; font-weight:bold;">Danh Sách Học Phần Cần Đánh Giá </span>
				             </td>
       	                
						</tr>
						
						
						<tr height="30"  bordercolor="#FFFFFF" >  
							  <td  style="font-size:18px; font-weight:bold" align="center" width="80"  class="bg bg3">
									Mã HP
							  </td>
							  <td  style="font-size:18px; font-weight:bold" align="center" width="200"  class="bg">
									Tên HP
							  </td>
							  <td  style="font-size:18px; font-weight:bold" align="center" width="100"  class="bg">
									STT Nhóm
							  </td>
							  <td  style="font-size:18px; font-weight:bold" align="center" width="200" class="bg">
									Giảng Viên Giảng Dạy
							  </td>
							  <td  style="font-size:18px; font-weight:bold" align="center" width="100"  class="bg1 bg4">
									Đánh Giá
							  </td>
							  <td  style="font-size:18px; font-weight:bold" align="center" width="120"  class="bg1 bg4">
									Trạng Thái Đánh Giá
							  </td>
						</tr>
						
				<?php 
				
				$sql=mysql_query("select a.ma_hp,b.ten_hp,a.stt_nhom,c.ten_gv,a.ma_hknk from `hoc` a,`hoc phan` b,`giang vien` c, `lop hoc phan` d where a.ma_hknk = (select max(ma_hknk) from `hocki nienkhoa`) and b.ma_hp=a.ma_hp and d.ma_gv=c.ma_gv and a.ma_hp=d.ma_hp and a.stt_nhom=d.stt_nhom and a.ma_hknk=d.ma_hknk and a.ma_sv='$masv' ");
				while ($kq = mysql_fetch_row($sql) )
				{
				   $ma_hp = $kq[0];
				   $ten_hp = $kq[1];
				   $stt= $kq[2];
				   $ten_gv = $kq[3];
				   $hknk= $kq[4];
				   ?>
				   
				        <tr   bordercolor="#FFFFFF" height="25" >  
							  <td   align="center" width="120"  class="bg bg3" style="font-size:20px;">
									<?php echo $ma_hp; ?> 
							  </td>
							  <td   align="center" width="280"  class="bg" style="font-size:20px;">
									<?php echo $ten_hp; ?>
							  </td>
							  <td   align="center" width="100"  class="bg" style="font-size:20px;">
									<?php echo $stt; ?>
							  </td>
							  <td   align="center" width="200" class="bg" style="font-size:20px;">
									<?php echo $ten_gv; ?>
							  </td>
							  <td  style="font-size:20px; font-weight:bold" align="center" width="100"  class="bg1 bg4" >
									 <a class="mo" href="<?php echo "sv-danhgia.php?ma=$ma_hp&&nhom=$stt&&hk=$hknk";?>" target="_blank">Mở</a> 
							  </td>
							  <td align="center">
							  <?php
							     $sql1=mysql_query("select * from `danh gia` where ma_sv='$masv' and stt_nhom='$stt' and ma_hp='$ma_hp' and ma_hknk='$hknk'");
					             $count=mysql_num_rows($sql1);
								 if($count>0) echo "<img border='0' src='image/duyet1.png' width='20' height='20' />";
							  ?>
							  </td>
						</tr>
				   
				<?php
				 }
				
				?>		
						
					   
				</table>
		
       </td>
	    
	</tr>
<!-- cuối trang -->  
	<tr> <td height="55" width="100%" bordercolor="#FFFFFF"></td> </tr>

	<tr> <td height="28" background="image/footer.gif">
    	<table width="100%"> <tr >
    	
    	</tr> </table>
    </td> </tr>
</table>

</body>
</html>
